package com.mxx.pmxt.dao;

import com.mxx.pmxt.model.GoodsModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GoodsModelMapper {
    int deleteByPrimaryKey(Integer gid);

    int insert(GoodsModel record);

    int insertSelective(GoodsModel record);

    GoodsModel selectByPrimaryKey(Integer gid);

    int updateByPrimaryKeySelective(GoodsModel record);

    int updateByPrimaryKey(GoodsModel record);

    int countSelectBeforeCheckByUser(@Param("uname")String uname);
    //查询当前用户发布的未审核商品总数,gstatus = 0

    List<GoodsModel> selectBeforeCheckByPageByUser(@Param("startRow")int startRow, @Param("pageSize")int pageSize,@Param("uname")String uname);
    //分页查询当前用户发布的未审核商品列表,gstatus = 0

    int countSelectAfterCheckByUser(@Param("uname")String uname);
    //查询当前用户发布拍卖中的商品总数，gstatus = 1

    List<GoodsModel> selectAfterCheckByPageByUser(@Param("startRow")int startRow, @Param("pageSize")int pageSize,@Param("uname")String uname);
    //分页查询当前用户发布拍卖中的商品，gstatus = 1

    int countSelectEndCheckByUser(@Param("uname")String uname);
    //查询当前用户发布拍卖结束的商品总数，gstatus = 2

    List<GoodsModel> selectEndCheckByPageByUser(@Param("startRow")int startRow, @Param("pageSize")int pageSize,@Param("uname")String uname);
    //分页查询当前用户发布拍卖结束的商品，gstatus = 2

    int countSelectFalseCheckByUser(@Param("uname")String uname);
    //查询当前用户发布审核不通过的商品总数，gstatus = 3

    List<GoodsModel> selectFalseCheckByPageByUser(@Param("startRow")int startRow, @Param("pageSize")int pageSize,@Param("uname")String uname);
    //分页查询当前用户发布审核不通过的商品，gstatus = 3

    int countSelectBeforeCheck();
    //查询全部待审核订单总数,gstatus = 0

    List<GoodsModel> selectBeforCheckByPage(@Param("startRow")int startRow, @Param("pageSize")int pageSize);
    //分页查询待审核订单列表

    int countSelectAfterCheck();
    //查询全部审核通过订单总数,gstatus = 1

    List<GoodsModel> selectAfterCheckByPage(@Param("startRow")int startRow, @Param("pageSize")int pageSize);
    //分页查询审核通过订单列表

    int countSelectFalseCheck();
    //查询全部审核不通过订单总数,gstatus = 3

    List<GoodsModel> selectFalseCheckByPage(@Param("startRow")int startRow, @Param("pageSize")int pageSize);
    //分页查询审核不通过订单列表

    int countSelectEndCheck();
    //查询全部结束拍卖订单总数,gstatus = 2

    List<GoodsModel> selectEndCheckByPage(@Param("startRow")int startRow, @Param("pageSize")int pageSize);
    //分页查询审核结束拍卖订单列表

    int countSelectAfterCheckByKinds(@Param("kindid")int kindid);
    //查询全部审核通过分类订单总数,gstatus = 1

    List<GoodsModel> selectAfterCheckByPageByKinds(@Param("startRow")int startRow, @Param("pageSize")int pageSize,@Param("kindid")int kindid);
    //分页查询审核通过其他订单列表

    int countSelectAfterByName(@Param("gname") String gname);

    List<GoodsModel> selectAfterByPageByName(@Param("gname") String gname,@Param("startRow")int startRow, @Param("pageSize")int pageSize);
    //分页模糊查询商品

    List<GoodsModel> selectAllAfterCheck();
}